const jwt = require('jsonwebtoken');
const cert = 'helloWorld'

module.exports = {

  createToken(data) {
    return jwt.sign({ data: data }, cert, { expiresIn: 60 * 60 });
  },

  verifyToken(token) {
    const decode = jwt.verify(token, cert);
    return decode.data
  }
}
